﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CodeGenerator.BaseUI;
using CodeGenerator.Core;
using ICSharpCode.TextEditor.Document;
using CodeGenerator.Common;

namespace CodeGenerator.UI
{
    public partial class FrmShowCode : BaseFormEx
    {
        private string content;
        public FrmShowCode(FileType fileType,string content)
        {
            InitializeComponent();

            this.content = content;
            string style = "C#";

            if (fileType == FileType.cs)
            {
                style = "C#";
            }
            else if (fileType == FileType.sql)
            {
                style = "TSQL";
            }
            else if (fileType == FileType.html)
            {
                style = "HTML";
            }
            txt_ShowCode.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(style);
            txt_ShowCode.Encoding = System.Text.Encoding.Default;
        }

        private void FrmShowCode_Load(object sender, EventArgs e)
        {
            txt_ShowCode.Text = content;
        }
    }
}
